
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>H264 · Aivin开发笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Aivin">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="YUV.html" />
    
    
    <link rel="prev" href="RTCP.html" />
    

    
        <link rel="shortcut icon" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../assets/images/favicon.ico' type="image/x-icon">
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    项目说明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../linux/linux基础.html">
            
                <a href="../linux/linux基础.html">
            
                    
                    linux
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../linux/linux基础.html">
            
                <a href="../linux/linux基础.html">
            
                    
                    linux基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../linux/android底层开发.html">
            
                <a href="../linux/android底层开发.html">
            
                    
                    android底层开发
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../c语言/c基础.html">
            
                <a href="../c语言/c基础.html">
            
                    
                    c
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../c语言/c基础.html">
            
                <a href="../c语言/c基础.html">
            
                    
                    c基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../c++/c++基础.html">
            
                <a href="../c++/c++基础.html">
            
                    
                    c++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../c++/c++基础.html">
            
                <a href="../c++/c++基础.html">
            
                    
                    c++基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../QT/QT基础.html">
            
                <a href="../QT/QT基础.html">
            
                    
                    QT
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../QT/QT基础.html">
            
                <a href="../QT/QT基础.html">
            
                    
                    QT基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../jni/JNI基础.html">
            
                <a href="../jni/JNI基础.html">
            
                    
                    JNI
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../jni/JNI基础.html">
            
                <a href="../jni/JNI基础.html">
            
                    
                    JNI基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../jni/JNI例子.html">
            
                <a href="../jni/JNI例子.html">
            
                    
                    JNI例子
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../SDL/SDL基础.html">
            
                <a href="../SDL/SDL基础.html">
            
                    
                    SDL
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../SDL/SDL基础.html">
            
                <a href="../SDL/SDL基础.html">
            
                    
                    SDL基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../ffmpeg/ffmpeg基础.html">
            
                <a href="../ffmpeg/ffmpeg基础.html">
            
                    
                    ffmpeg
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../ffmpeg/ffmpeg基础.html">
            
                <a href="../ffmpeg/ffmpeg基础.html">
            
                    
                    ffmpeg基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../ffmpeg/ffmpeg示例代码.html">
            
                <a href="../ffmpeg/ffmpeg示例代码.html">
            
                    
                    ffmpeg示例代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../ffmpeg/ffmpeg软解rtsp简单直播.html">
            
                <a href="../ffmpeg/ffmpeg软解rtsp简单直播.html">
            
                    
                    ffmpeg软解rtsp简单直播
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../ffmpeg/rtsp服务器.html">
            
                <a href="../ffmpeg/rtsp服务器.html">
            
                    
                    rtsp服务器Windows
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../opencv/opencv模块.html">
            
                <a href="../opencv/opencv模块.html">
            
                    
                    opencv模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../opencv/opencv.html">
            
                <a href="../opencv/opencv.html">
            
                    
                    opencv
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../openSLES/openSLES基础.html">
            
                <a href="../openSLES/openSLES基础.html">
            
                    
                    openSLES
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../openSLES/openSLES基础.html">
            
                <a href="../openSLES/openSLES基础.html">
            
                    
                    openSLES基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../SoundTouch/移植SoundTouch.html">
            
                <a href="../SoundTouch/移植SoundTouch.html">
            
                    
                    SoundTouch
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../SoundTouch/移植SoundTouch.html">
            
                <a href="../SoundTouch/移植SoundTouch.html">
            
                    
                    移植SoundTouch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../SoundTouch/实现音频变速和变调.html">
            
                <a href="../SoundTouch/实现音频变速和变调.html">
            
                    
                    实现音频变速和变调
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../openGLES/openGLES基础.html">
            
                <a href="../openGLES/openGLES基础.html">
            
                    
                    openGLES模块
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../openGLES/openGLES基础.html">
            
                <a href="../openGLES/openGLES基础.html">
            
                    
                    openGLES基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../openGLES/GLSL基础.html">
            
                <a href="../openGLES/GLSL基础.html">
            
                    
                    GLSL基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="../openGLES/openglES示例.html">
            
                <a href="../openGLES/openglES示例.html">
            
                    
                    openglES示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="音视频基础.html">
            
                <a href="音视频基础.html">
            
                    
                    音视频术语-文件格式-协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="音视频基础.html">
            
                <a href="音视频基础.html">
            
                    
                    音视频基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="RTSP.html">
            
                <a href="RTSP.html">
            
                    
                    RTSP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="RTP.html">
            
                <a href="RTP.html">
            
                    
                    RTP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="RTCP.html">
            
                <a href="RTCP.html">
            
                    
                    RTCP
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13.5" data-path="H264.html">
            
                <a href="H264.html">
            
                    
                    H264
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="YUV.html">
            
                <a href="YUV.html">
            
                    
                    YUV
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="SurfaceView.html">
            
                <a href="SurfaceView.html">
            
                    
                    SurfaceView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="RTMP.html">
            
                <a href="RTMP.html">
            
                    
                    RTMP
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="AAC详解.html">
            
                <a href="AAC详解.html">
            
                    
                    AAC详解
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../音视频相关代码/音视频相关代码.html">
            
                <a href="../音视频相关代码/音视频相关代码.html">
            
                    
                    音视频相关代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../ndk/NDK编译基础.html">
            
                <a href="../ndk/NDK编译基础.html">
            
                    
                    NDK工程编译
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../ndk/NDK编译基础.html">
            
                <a href="../ndk/NDK编译基础.html">
            
                    
                    NDK编译基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../ndk/cmake方式.html">
            
                <a href="../ndk/cmake方式.html">
            
                    
                    cmake
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../ndk/Android.mk模板.html">
            
                <a href="../ndk/Android.mk模板.html">
            
                    
                    Android.mk
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../ndk/Application.mk模板.html">
            
                <a href="../ndk/Application.mk模板.html">
            
                    
                    Application.mk
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >H264</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><li><span class="title-icon "></span><a href="#h264"><b>1. </b>h264</a></li><ul><li><span class="title-icon "></span><a href="#h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;"><b>1.1. </b>h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;</a></li><li><span class="title-icon "></span><a href="#h264&#x67E5;&#x770B;&#x5DE5;&#x5177;"><b>1.2. </b>H264&#x67E5;&#x770B;&#x5DE5;&#x5177;</a></li><li><span class="title-icon "></span><a href="#java&#x5C42;&#x89E3;&#x7801;-&#x663E;&#x793A;-h264&#x65B9;&#x6848;"><b>1.3. </b>java&#x5C42;&#x89E3;&#x7801; &#x663E;&#x793A; H264&#x65B9;&#x6848;</a></li><li><span class="title-icon "></span><a href="#h264&#x8F6C;mp4---java&#x5B9E;&#x73B0;&#x65B9;&#x6848;"><b>1.4. </b>H264&#x8F6C;MP4   Java&#x5B9E;&#x73B0;&#x65B9;&#x6848;</a></li></ul></ul></div><a href="#h264" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="h264"><a name="h264" class="anchor-navigation-ex-anchor" href="#h264"><i class="fa fa-link" aria-hidden="true"></i></a>1. h264</h1>
<pre><code class="lang-xml">1&#x3001;&#x4ECE;4.1.2&#x5F00;&#x59CB;&#x652F;&#x6301;java&#x5C42;&#x7684;mediacodec
2&#x3001;&#x4ECE;5.0&#x5F00;&#x59CB;&#x652F;&#x6301; native&#x5C42;&#x7684;mediacodec
</code></pre>
<h2 id="h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;"><a name="h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;" class="anchor-navigation-ex-anchor" href="#h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>1.1. h264&#x5E38;&#x7528;&#x7684;&#x5E27;&#x7C7B;&#x578B;</h2>
<table>
<thead>
<tr>
<th>&#x7C7B;&#x578B;</th>
<th>&#x8BF4;&#x660E;</th>
</tr>
</thead>
<tbody>
<tr>
<td>00 00 00 01 06</td>
<td>&#x589E;&#x5F3A; &#x5E27;</td>
</tr>
<tr>
<td>00 00 00 01 41</td>
<td>61&#x548C;41&#x5176;&#x5B9E;&#x90FD;&#x662F;P&#x5E27;&#xFF08;type&#x503C;&#x4E3A;1&#xFF09;&#xFF0C;&#x53EA;&#x662F;&#x91CD;&#x8981;&#x7EA7;&#x522B;&#x4E0D;&#x4E00;&#x6837;</td>
</tr>
<tr>
<td>00 00 00 01 61</td>
<td>P&#x5E27;</td>
</tr>
<tr>
<td>00 00 00 01 65</td>
<td>IDR &#x3001;I&#x5E27;</td>
</tr>
<tr>
<td>00 00 00 01 67</td>
<td>SPS</td>
</tr>
<tr>
<td>00 00 00 01 68</td>
<td>PPS</td>
</tr>
</tbody>
</table>
<h2 id="h264&#x67E5;&#x770B;&#x5DE5;&#x5177;"><a name="h264&#x67E5;&#x770B;&#x5DE5;&#x5177;" class="anchor-navigation-ex-anchor" href="#h264&#x67E5;&#x770B;&#x5DE5;&#x5177;"><i class="fa fa-link" aria-hidden="true"></i></a>1.2. H264&#x67E5;&#x770B;&#x5DE5;&#x5177;</h2>
<p>&#x4EE5;&#x4E8C;&#x8FDB;&#x5236;&#x65B9;&#x5F0F;&#x67E5;&#x770B;H264&#x6587;&#x4EF6;&#x7684;&#x5DE5;&#x5177;&#x53EF;&#x4EE5;&#x7528; <a href="http://www.sublimetext.com/" target="_blank">sublime_text</a></p>
<p>&#x4EE5;&#x56FE;&#x5F62;&#x5316;&#x65B9;&#x5F0F;&#x67E5;&#x770B;H264&#x6587;&#x4EF6;&#x7684;I&#x5E27;P&#x5E27;&#x7B49;&#x53EF;&#x4EE5;&#x7528;<a href="http://opbrnhxqg.bkt.clouddn.com/Elecard-h264%E6%96%87%E4%BB%B6%E6%9F%A5%E7%9C%8B%E5%99%A8%E6%92%AD%E6%94%BE%E5%99%A8.rar" target="_blank">Elecard StreamEye </a></p>
<h2 id="java&#x5C42;&#x89E3;&#x7801;-&#x663E;&#x793A;-h264&#x65B9;&#x6848;"><a name="java&#x5C42;&#x89E3;&#x7801;-&#x663E;&#x793A;-h264&#x65B9;&#x6848;" class="anchor-navigation-ex-anchor" href="#java&#x5C42;&#x89E3;&#x7801;-&#x663E;&#x793A;-h264&#x65B9;&#x6848;"><i class="fa fa-link" aria-hidden="true"></i></a>1.3. java&#x5C42;&#x89E3;&#x7801; &#x663E;&#x793A; H264&#x65B9;&#x6848;</h2>
<pre><code class="lang-xml">&#x81EA;&#x5DF1;&#x89E3;&#x6790; H264&#x534F;&#x8BAE;&#xFF0C;&#x7136;&#x540E;&#x5C06;&#x6570;&#x636E;&#x4F5C;&#x4E3A;&#x4E00;&#x5E27;&#x4E00;&#x5E27;&#x5730;&#x9001;&#x7ED9; java&#x5C42;&#x7684; mediacodec &#x89E3;&#x7801; &#x3002;
&#x7136;&#x540E;&#x7ED9; mediacodec &#x8FDB;&#x884C;&#x6E32;&#x67D3;&#x663E;&#x793A; &#x3002;
</code></pre>
<pre><code class="lang-java"><span class="hljs-comment">/**
 <span class="hljs-doctag">@param</span> surface Specify a surface on which to render the output of this
                decoder. Pass {<span class="hljs-doctag">@code</span> null} as {<span class="hljs-doctag">@code</span> surface} if the
                codec does not generate raw video output (e.g. not a video
                decoder) and/or if you want to configure the codec for
                {<span class="hljs-doctag">@link</span> ByteBuffer} output.
*/</span>
 mMeidaCodec.configure(mediaFormat, mSurfaceView.getHolder().getSurface(), <span class="hljs-keyword">null</span>, <span class="hljs-number">0</span>);
</code></pre>
<h2 id="h264&#x8F6C;mp4---java&#x5B9E;&#x73B0;&#x65B9;&#x6848;"><a name="h264&#x8F6C;mp4---java&#x5B9E;&#x73B0;&#x65B9;&#x6848;" class="anchor-navigation-ex-anchor" href="#h264&#x8F6C;mp4---java&#x5B9E;&#x73B0;&#x65B9;&#x6848;"><i class="fa fa-link" aria-hidden="true"></i></a>1.4. H264&#x8F6C;MP4   Java&#x5B9E;&#x73B0;&#x65B9;&#x6848;</h2>
<p>&#x57FA;&#x4E8E;<a href="https://github.com/sannies/mp4parser" target="_blank">mp4parser</a>  &#xFF08; isoviewer-1.0-RC-35.jar&#xFF09;&#x5B9E;&#x73B0;&#x3002;</p>
<pre><code class="lang-java"><span class="hljs-comment">/**
  &#x6B64;&#x65B9;&#x6848;&#x9047;&#x5230;Bug :
  Attempt to read from field &apos;boolean com.googlecode.mp4parser.
  h264.model.SeqParameterSet.residual_color_transform_flag&apos; on
  a null object reference
  &#x89E3;&#x51B3;&#x529E;&#x6CD5;:&#x5728;&#x6211;&#x7684;&#x5E94;&#x7528;&#x573A;&#x666F;&#x4E2D;&#xFF0C;&#x6211;&#x662F;&#x786E;&#x4FDD;H264&#x7684;&#x5934;&#x90E8;&#x4FDD;&#x5B58;&#x4E86;SPS &#x548C; PPS .
  &#x9274;&#x4E8E;&#x8F6C;&#x6362;&#x901F;&#x5EA6;&#x548C;&#x6B64;Bug &#x6211;&#x540E;&#x6765;&#x653E;&#x5F03;&#x4E86;&#x8FD9;&#x4E2A;&#x65B9;&#x6848;&#xFF0C;&#x8F6C;&#x7528; C&#x5C42;&#x4F7F;&#x7528;ffmpeg&#x7684;&#x65B9;&#x6848;&#x3002;
 * <span class="hljs-doctag">@param</span> h264Path  h264&#x6587;&#x4EF6;&#x7EDD;&#x5BF9;&#x8DEF;&#x5F84;
 * <span class="hljs-doctag">@param</span> mp4Path  mp4&#x7EDD;&#x5BF9;&#x8DEF;&#x5F84;
 * <span class="hljs-doctag">@return</span>  &#x662F;&#x5426;&#x8F6C;&#x7801;&#x6210;&#x529F;
 */</span>
<span class="hljs-meta">@Deprecated</span>
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">boolean</span>  <span class="hljs-title">h264ToMp4Parse</span><span class="hljs-params">(String h264Path , String mp4Path )</span>
</span>{
    <span class="hljs-keyword">try</span> {
        H264TrackImpl h264Track = <span class="hljs-keyword">new</span> H264TrackImpl(<span class="hljs-keyword">new</span> FileDataSourceImpl(h264Path));
        Movie movie = <span class="hljs-keyword">new</span> Movie();
        movie.addTrack(h264Track);
        Container mp4file = <span class="hljs-keyword">new</span> DefaultMp4Builder().build(movie);
        FileChannel fc = <span class="hljs-keyword">new</span> FileOutputStream(<span class="hljs-keyword">new</span> File(mp4Path)).getChannel();
        mp4file.writeContainer(fc);
        fc.close();
        <span class="hljs-keyword">return</span>  <span class="hljs-keyword">true</span> ;
    }<span class="hljs-keyword">catch</span> (Exception exception){
        <span class="hljs-comment">//&#x8F6C;&#x7801;&#x5F02;&#x5E38;</span>
        <span class="hljs-keyword">return</span>  <span class="hljs-keyword">false</span> ;
    }
}<span class="hljs-comment">//</span>
</code></pre>
<footer class="page-footer"><span class="copyright">&#x65E0;&#x7248;&#x6743; &#x53EF;&#x4EE5;&#x65E0;&#x9650;&#x5236;&#x4F7F;&#x7528;&#xFF01; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x66F4;&#x65B0;&#x65F6;&#x95F4;&#xFF1A;
2020-08-20 14:17:31
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="RTCP.html" class="navigation navigation-prev " aria-label="Previous page: RTCP">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="YUV.html" class="navigation navigation-next " aria-label="Next page: YUV">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"H264","level":"1.13.5","depth":2,"next":{"title":"YUV","level":"1.13.6","depth":2,"path":"chinese/视频相关/YUV.md","ref":"chinese/视频相关/YUV.md","articles":[]},"previous":{"title":"RTCP","level":"1.13.4","depth":2,"path":"chinese/视频相关/RTCP.md","ref":"chinese/视频相关/RTCP.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-search","search-plus","todo","anchor-navigation-ex","copy-code-button","versions-select","fontsettings","sharing","tbfed-pagefooter","donate","local-video","splitter","edit-link","expandable-chapters","favicon","theme-comscore","local-video"],"styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"无版权 可以无限制使用！","modify_label":"该文件更新时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"todo":{},"splitter":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"versions-select":{"type":"branches"},"donate":{"alipay":"https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201803011956_osChina_支付宝收款码.png","alipayText":"支付宝打赏","button":"打赏","title":"","wechat":"https://gitee.com/hnyer/filesOfGitbook/raw/master/files/201803011956_osChina_微信收款码.png","wechatText":"微信打赏"},"fontsettings":{"family":"sans","size":2,"theme":"sepia"},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":true},"favicon":{"shortcut":"assets/images/favicon.ico","bookmark":"assets/images/favicon.ico"},"theme-comscore":{},"local-video":{},"copy-code-button":{},"versions":{"options":[{"value":"https://www.aivin666.cn/java_android/","text":"v1.0"}]},"sharing":{"all":["facebook","google","twitter","weibo","instapaper"],"facebook":false,"google":true,"instapaper":false,"twitter":false,"vk":false,"weibo":true},"edit-link":{"label":"托管页面","base":"https://www.baidu.com/"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"Aivin","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Aivin开发笔记","language":"zh-hans","gitbook":"*","description":"Aivin开发笔记"},"file":{"path":"chinese/视频相关/H264.md","mtime":"2020-08-20T06:17:31.531Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-08-20T09:02:41.305Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    </body>
</html>

